﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;

namespace QuickWeather.Core
{
    public class ProviderConfig
    {
        public ProviderConfig()
        {
            this.Title = string.Empty;
            this.Uri = string.Empty;
            this.WeatherXslt = string.Empty;
            this.AutoUpdate = false;
            this.AutoUpdateInterval = 0;
            this.FixedCityList = false;
            this.CityListUri = string.Empty;
            this.CityListXslt = string.Empty;
            this.CityList = string.Empty;

            Load();
        }

        public void Load()
        {
            this.Load(GetPath());
        }

        public void Load(string path)
        {
            
        }

        public void Save()
        {
            this.Save(GetPath());
        }

        public void Save(string path)
        {
        }

        /// <summary>
        /// Gets path to current weather provider config
        /// </summary>
        /// <returns>Path to current weather provider config</returns>
        private string GetPath()
        {
            return string.Empty;
        }

        /// <summary>
        /// Gets weather provider title
        /// </summary>
        public string Title { get; private set; }
        /// <summary>
        /// Gets weather provider site uri
        /// </summary>
        public string Uri { get; private set; }
        /// <summary>
        /// Gets weather provider transformator
        /// </summary>
        public string WeatherXslt { get; private set; }
        /// <summary>
        /// Gets autoupdate state
        /// </summary>
        public bool AutoUpdate { get; private set; }
        /// <summary>
        /// Gets autoupdate interval
        /// </summary>
        public long AutoUpdateInterval { get; private set; }
        /// <summary>
        /// Gets fixed city list state
        /// </summary>
        public bool FixedCityList { get; private set; }
        /// <summary>
        /// Gets weather provider city list uri
        /// </summary>
        public string CityListUri { get; private set; }
        /// <summary>
        /// Gets weather provider city list transformator
        /// </summary>
        public string CityListXslt { get; private set; }
        /// <summary>
        /// Gets weather provider city list, if FixedCityList are enabled, else string.Empty
        /// </summary>
        public string CityList { get; private set; }
    }
}
